package com.wms.dao;


import com.wms.domain.InStoreDetailDomain;
import com.wms.domain.InStoreIdxDomain;
import com.wms.domain.OutStoreDetailDomain;
import com.wms.domain.OutStoreIdxDomain;
import com.wms.dto.InStoreDetailDto;
import com.wms.dto.OutStoreDetailDto;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.mapstruct.Mapper;

import java.util.HashMap;
import java.util.List;

@Mapper
public interface OutStoreMapper {

    public void addDeliver(OutStoreIdxDomain outStoreIdxDomain);

    public void addDeliverDetail(OutStoreDetailDomain outStoreDetailDomain);

    public void deliverUpdate(OutStoreIdxDomain outStoreIdxDomain);

    public void updateDetail(OutStoreDetailDomain outStoreDetailDomain);

    @Delete("DELETE FROM out_store_detail WHERE out_store_id = ${id}")
    public void deleteDeliverDetail(Long id);

    public List<HashMap<String, Object>> getOutStoreDetail(Long out_store_id);

    @Select("select * from out_store_detail where out_store_id = ${out_store_id}")
    public List<OutStoreDetailDomain> getOutStoreDetailForDomain(Long out_store_id);

//    @Select("select * from in_store_detail where id = ${id}")
//    public InStoreDetailDomain getInStoreDetailById(Long id);
//
//    @Select("select * from in_store_idx where id = ${id}")
//    public InStoreIdxDomain getInStoreIdxById(Long id);
    public List<HashMap<String, Object>> getDeliverPage(OutStoreIdxDomain outStoreIdxDomain);

    public List<HashMap<String, Object>> getDeliverDetailPage(OutStoreDetailDto outStoreDetailDto);

//    public void InStoreFinish();

    @Select("select out_store_id from out_store_detail where id = ${out_store_detail_id} LIMIT 1")
    public Long getOutStoreIdxIdByDetailId(Long out_store_detail_id);
}
